#ifndef SIPTRANSESSIONBASE_HPP__
#define SIPTRANSESSIONBASE_HPP__

#include "SipGDServiceConfigure.hpp"
#include "SipSessionBase.hpp"
#include "SipClnTransaction.hpp"
#include "SipSrvTransaction.hpp"

namespace wtsip{


class WTGD_SIPSRV_PUBLIC CSipTranSession:
    public CSipSessionBase,
    public CSipClnTransactionCallback,
    public CSipSrvTransactionListener
{
public:

    CSipTranSession(CSipGDService& sv, CSipClnTransaction& clntran);

    CSipTranSession(CSipGDService& sv, CSipSrvTransaction& svtran);

    virtual ~CSipTranSession();

    virtual bool messageDresser(SipMessage& msg);

    virtual bool start(const std::string& body);

    virtual bool stop();

    virtual bool replyOK(const std::string& body);

    virtual bool replyFail(CSipSessionBase::EFailReason r);

    virtual bool replyTrying();

    virtual bool reply(const std::string& body, CSipSessionBase::EFailReason r);

    ///////////////////// Transaction handle method ////////////////////

    virtual bool onResponse(CSipClnTransaction& clntran, SipMessage& msg);

    virtual bool onDestroy(CSipClnTransaction& clntran);

    virtual bool onRequest(CSipSrvTransaction& srvtran, SipMessage& msg);

    virtual bool onDestroy(CSipSrvTransaction& srvtran);

protected:

    virtual bool onDestroy();

};


}//namespace


#endif


